home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / macros / hplot.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  3KB  |  101 lines

  1. /* macro to plot model to printer or postscript file */
  2. options results
  3. parse arg dev num
  4.  
  5. address ami2d
  6.  
  7. 'coord(cart)'
  8. 'info(window)'
  9. parse var result xmin xmax ymin ymax
  10. 'info'
  11. parse var result nnodes nelems nsolns
  12.  
  13. m = open('outfile','ram:plot.gnu','w')
  14.  
  15. select
  16.     when dev='dj' then do
  17.         m = writeln('outfile','set size 1.0,.83')
  18.         m = writeln('outfile','set term hpdj 300')
  19.         m = writeln('outfile','set output "par:"')
  20.     end
  21.     when dev='ps' then do
  22.         m = writeln('outfile','set size .6,.65')
  23.         m = writeln('outfile','set term postscript portrait "Bodoni-Normal" 14')
  24.         m = writeln('outfile','set output "ram:plot.ps"')
  25.     end
  26.     otherwise nop
  27. end
  28.  
  29. m = writeln('outfile','set xlabel')
  30. m = writeln('outfile','set ylabel')
  31. m = writeln('outfile','set nokey')
  32. m = writeln('outfile','set noxtics')
  33. m = writeln('outfile','set noytics')
  34. m = writeln('outfile','set noxzeroaxis')
  35. m = writeln('outfile','set noyzeroaxis')
  36. if num='nd' then do
  37.     dd = (xmax - xmin)/100
  38.     do i=0 to nnodes-1
  39.         'info(node,'i')'
  40.         parse var result nd id x1 y1
  41.         m = writeln('outfile','set label "'nd'" at 'x1 + dd','y1 - dd)
  42.     end
  43. end
  44. if num='id' then do
  45.     dd = (xmax - xmin)/100
  46.     do i=0 to nnodes-1
  47.         'info(node,'i')'
  48.         parse var result nd id x1 y1
  49.         m = writeln('outfile','set label "'id'" at 'x1 + dd','y1 - dd)
  50.     end
  51. end
  52. m = writeln('outfile','plot ['xmin':'xmax'] ['ymin':'ymax'] ''pipe:elems'' with lines,\')
  53. m = writeln('outfile','''pipe:nodes'' with points 3')
  54. m = close('outfile')
  55.  
  56. address command 'run gnuplot ram:plot.gnu'
  57.  
  58. m = open('outfile','pipe:elems','w')
  59. m = writeln('outfile','# model - 'modelfile' nelems = 'nelems)
  60.  
  61. do i=0 to nelems-1
  62.     'info(elem,'i')'
  63.     parse var result nd id mid nn ni n.1 n.2 n.3 n.4 n.5 n.6 n.7 n.8 n.9
  64.     m = writeln('outfile','# element 'id)
  65.     if nn > 4 then do
  66.         nc = nn % 2
  67.         nm = 2
  68.     end
  69.     else do
  70.         nc = nn
  71.         nm = 1
  72.     end
  73.     do j=1 to nc
  74.         do k=1 to nm
  75.             l = j + nc*(k - 1)
  76.             'info(node,'n.l')'
  77.             parse var result nd id x1 y1
  78.             m = writech('outfile',left(x1,18))
  79.             m = writeln('outfile',left(y1,18))
  80.         end
  81.     end
  82.     'info(node,'n.1')'
  83.     parse var result nd id x1 y1
  84.     m = writech('outfile',left(x1,18))
  85.     m = writeln('outfile',left(y1,18))
  86.     m = writeln('outfile','')
  87. end
  88. m = close('outfile')
  89.  
  90. m = open('outfile','pipe:nodes','w')
  91. m = writeln('outfile','# model - 'modelfile' nnodes = 'nnodes)
  92.  
  93. do i=0 to nnodes-1
  94.     'info(node,'i')'
  95.     parse var result nd id x1 y1
  96.     m = writech('outfile',left(x1,18))
  97.     m = writeln('outfile',left(y1,18))
  98. end
  99. m = close('outfile')
  100. exit
  101.